package indi.h.filefilter;

import java.io.File;
import java.io.IOException;

import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
import org.apache.tika.Tika;
import org.apache.tika.exception.TikaException;

import indi.h.filefilter.filters.Filter.FilterR;
import indi.h.filefilter.listeners.InterceptorListener;

public class Test {
	private final static Logger l = Logger.getLogger(Test.class);

	public static void main(String[] args) throws IOException, TikaException {
		// PropertyConfigurator.configure(Test.class.getClassLoader().getResourceAsStream("indi/h/filefilter/log4j.properties"));
		// System.out.println("sss");
		// BasicFileInterceptor bff = new BasicFileInterceptor();
		// bff.setContentF(new String[] { "screen", "中" });
		// File listFiles = new File("c:/test2/1.txt");
		// FilterR intercept = bff.intercept(listFiles.getAbsolutePath(), new
		// InterceptorListener() {
		//
		// @Override
		// public void interceptEnd(FilterR R) {
		// // TODO Auto-generated method stub
		// System.out.println(R.getMsg());
		// }
		// });
		// System.out.println(intercept.getMsg());

		Tika ti = new Tika();
		File[] fs = new File("c:/test2").listFiles();
		while (true) {
			for (File f : fs) {
				String parseToString = ti.parseToString(f);
				System.out.println(parseToString);
			}
		}

	}
}
